import undetected_chromedriver as uc
import selenium
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC


options = uc.ChromeOptions()
options.user_data_dir = "/Users/jinjiakk/应用程序文件/selenium/user"
driver_path = "/Users/jinjiakk/应用程序文件/selenium/chromedriver-mac-x64/chromedriver-mac-x64/chromedriver"
browser_path = "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
# browser_path = "/Applications/Google Chrome.app"



def a():
    driver = uc.Chrome(
        driver_executable_path=driver_path,
        browser_executable_path=browser_path,
        options=options,
        enable_cdp_events=True,
        port=53610
    ) 
    
    return driver

driver = a()
# input("跳转")

url = "https://alidocs.dingtalk.com/i/nodes/20eMKjyp81R7pXXmsYMoxajlWxAZB1Gv?iframeQuery=utm_source%3Dportal%26utm_medium%3Dportal_recent&rnd=0.9437842097777894"
driver.get(url)

driver.page_source
input("获取")

ele = driver.find_elements(By.XPATH,".//div[@id='content-wrapper']")

ele = driver.find_elements(By.XPATH,".//div")
print(ele)
input("下载")
# driver.
ele.screenshot_as_png("./test.png")

